<%@page import="models.RoleModel"%>
<%@page import="admin.data.RoleData"%>
<%@page import="helpers.RoleMenuHelper"%>
<%@page import="models.StaffModel"%>
<%@page import="java.util.ArrayList"%>
<%@page import="helpers.StringHelper"%>
<%@page import="java.util.List"%>

<%
List<String> roles = new ArrayList<String>();
StaffModel staff = (StaffModel) request.getAttribute("staff_logged_in");

if (staff != null) {
	RoleData roleData = new RoleData();
	RoleModel role = roleData.get(staff.getUsername());
	if (role != null) {
		roles = role.getMenu();
	}
} else {
	//roles = RoleMenuHelper.getMenu100(roles);
}
%>

<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<link href="/admin/css/ddsmoothmenu.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="/admin/js/ddsmoothmenu.js"></script>
<script type="text/javascript">
<!--
jQuery(document).ready(function () {
	ddsmoothmenu.init({
		 mainmenuid: "navigation-menu", //menu DIV id
		 orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
		 classname: 'ddsmoothmenu nav-menu radius3', //class added to menu's outer DIV
		 //customtheme: ["#1c5a80", "#18374a"],
		 contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
	});
});
//-->
</script>
<% if (roles.size() > 0) { %>
<div id="navigation-menu" class="hidden">
	<ul>
		<li>
			<a href="/admin/dashboard">Trang Quản trị</a>
		</li>
		<% if (roles.contains("all") || roles.contains("manager-deals")) { %>
		<li>
			<a href="#">Quản lý deal</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("deal-manager")) { %>
				<li><a href="/admin/deal/manage"><span>Thống kê Deal</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("deal-list")) { %>
               	<li><a href="/admin/deal/list"><span>Danh sách Deal</span></a></li>
               	<% } %>
               	<% if (roles.contains("all") || roles.contains("deal-add")) { %>
               	<li><a href="/admin/deal/add"><span>Thêm Deal</span></a></li>
               	<% } %>
               	<% if (roles.contains("all") || roles.contains("ads-right")) { %>
               	<li><a href="/admin/ads/right">Quản lý Deal Quảng cáo</a></li>
               	<% } %>
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-sales")) { %>
		<li>
			<a href="#">Quản lý bán hàng</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("order-list")) { %>
				<li><a href="/admin/order/list"><span>Quản lý đơn hàng</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("sell-direct")) { %>
				<li><a href="/admin/sell/direct"><span>Bán hàng trực tiếp</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("sales-profit")) { %>
				<li><a href="/admin/sales/profit"><span>Báo cáo doanh số Display</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("sales-profit-detail")) { %>
               	<li><a href="/admin/sales/profit-detail"><span>Báo cáo doanh số chi tiết</span></a></li>
               	<% } %>
               	<% if (roles.contains("all") || roles.contains("sales-profit-by-saler")) { %>
               	<li><a href="/admin/sales/profit-by-saler"><span>Báo cáo bán hàng theo Saler</span></a></li>
               	<% } %>   
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-store")) { %>
		<li>
			<a href="/admin/store-item/list/">Quản lý Kho</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("store-item-add")) { %>
				<li><a href="/admin/store-item/add/" class="users menudrop"><span>Thêm sản phẩm</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("store-item-list")) { %>
				<li><a href="/admin/store-item/list/" class="users menudrop"><span>Danh sách sản phẩm</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("store-item-export")) { %>
				<li><a href="/admin/store-item/export/" class="users menudrop"><span>Xuất hàng theo LOC</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("store-item-import")) { %>
				<li><a href="/admin/store-item/import/" class="users menudrop"><span>Trả hàng theo LOC</span></a></li>
				<% } %>		
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-coordina")) { %>
		<li>
			<a href="/admin/coordina/list">Quản lý điều phối</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("route-list")) { %>
				<li><a href="/admin/route/list" class="users menudrop"><span>Quản lý tuyến</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("route-add")) { %>
				<li><a href="/admin/route/add" class="users menudrop"><span>Cấu hình tuyến</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("coordina-add")) { %>
				<li><a href="/admin/coordina/add" class="users menudrop"><span>Xuất tuyến</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("coordina-list")) { %>
				<li><a href="/admin/coordina/list" class="users menudrop"><span>Danh sách tuyến</span></a></li>
				<% } %>				
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("coordina-return")) { %>
		<li>
			<a href="/admin/coordina/return/">Cập nhật LOC</a>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-dealsemail")) { %>
		<li>
			<a href="#">Quản lý marketing</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("dealsemail-list")) { %>
				<li><a href="/admin/dealsemail/list"><span>Danh sách Email Marketing</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("dealsemail-create")) { %>
                <li><a href="/admin/dealsemail/create"><span>Tạo Email Marketing</span></a></li>
                <% } %>
                <% if (roles.contains("all") || roles.contains("statistic-email-marketing")) { %>
                <li><a href="/admin/statistic?action=email_marketing"><span>Thống kê Email Marketing</span></a></li>
                <% } %>
                <% if (roles.contains("all") || roles.contains("manager-email")) { %>
				<li>
					<a href="#">Quản lý email khách hàng</a>
					<ul>
						 <% if (roles.contains("all") || roles.contains("email-list")) { %>
						 <li><a href="/admin/email/list"><span>Danh sách email khách hàng</span></a></li>
						 <% } %>
						 <% if (roles.contains("all") || roles.contains("email-import")) { %>
		                 <li><a href="/admin/email/import"><span>Import Email vào hệ thống</span></a></li>
		                 <% } %>
		                 <% if (roles.contains("all") || roles.contains("email-export")) { %>
		                 <li><a href="/admin/email/export"><span>Export Email từ hệ thống</span></a></li>
		                 <% } %>
					</ul>
				</li>
				<% } %>
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-accounting")) { %>
		<li>
			<a href="/admin/coordina/accounting/">Kế toán</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("coordina-accounting")) { %>
				<li><a href="/admin/coordina/accounting/" class="salary"><span>Thu tiền giao nhận</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("delivery-salary")) { %>
				<li><a href="/admin/delivery-salary" class="salary"><span>Lương giao nhận</span></a></li>
				<% } %>
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-other")) { %>
		<li>
			<a href="#">Các quản lý khác</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("cooperation-list")) { %>
				<li><a href="/admin/cooperation/list" class="cooperation"><span>Liên hệ hợp tác</span></a></li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("geo-manager")) { %>
    			<li><a href="/admin/geo/list" class="geos menudrop"><span>Quản lý khu vực</span></a>
                	<ul>
                		<% if (roles.contains("all") || roles.contains("geo-list")) { %>
                    	<li><a href="/admin/geo/list"><span>Danh sách khu vực</span></a></li>
                    	<% } %>
                    	<% if (roles.contains("all") || roles.contains("geo-add")) { %>
                    	<li><a href="/admin/geo/add"><span>Cập nhật khu vực</span></a></li>     
                    	<% } %>                       	
                    </ul>
                </li>
                <% } %>
                <% if (roles.contains("all") || roles.contains("category-manager")) { %>
                <li><a href="/admin/category/list" class="categories menudrop"><span>Quản lý danh mục</span></a>
                	<ul>
                		<% if (roles.contains("all") || roles.contains("category-list")) { %>
                    	<li><a href="/admin/category/list"><span>Danh sách danh mục</span></a></li>
                    	<% } %>
                    	<% if (roles.contains("all") || roles.contains("category-add")) { %>
                    	<li><a href="/admin/category/add"><span>Cập nhật danh mục</span></a></li>
                    	<% } %>                            	
                    </ul>
                </li>
                <% } %>
			</ul>
		</li>
		<% } %>
		<% if (roles.contains("all") || roles.contains("manager-system")) { %>
		<li>
			<a href="#">Quản trị hệ thống</a>
			<ul>
				<% if (roles.contains("all") || roles.contains("staff-manager")) { %>
				<li>
					<a href="/admin/staff/list" class="users menudrop"><span>Quản lý nhân viên</span></a>
                    <ul>
                    	<% if (roles.contains("all") || roles.contains("staff-list")) { %>
                    	<li><a href="/admin/staff/list"><span>Danh sách nhân viên</span></a></li>
                    	<% } %>
                    	<% if (roles.contains("all") || roles.contains("staff-add")) { %>
                        <li><a href="/admin/staff/add"><span>Thêm nhân viên</span></a></li>
                        <% } %>
                    </ul>
				</li>
				<% } %>
				<% if (roles.contains("all") || roles.contains("user-manager")) { %>
				<li><a href="/admin/user/list" class="customer"><span>Quản lý khách hàng</span></a>
				<% } %>
				<!-- 
				<% if (roles.contains("all") || roles.contains("config-manager")) { %>
				<li><a href="/admin/config/site/form_site" class="editor menudrop"><span>Cấu hình</span></a>
                	<ul>
                		<% if (roles.contains("all") || roles.contains("config-site")) { %>
                    	<li><a href="/admin/config/site/form_site"><span>Cấu hình chung</span></a></li>
                    	<% } %>
                    	<% if (roles.contains("all") || roles.contains("config-layout")) { %>
                    	<li><a href="/admin/config/site/layout"><span>Cấu hình layout</span></a></li>
                    	<% } %>
                    </ul>
                </li>
                <% } %>
                 -->
                <% if (roles.contains("all") || roles.contains("page-manager")) { %>
                <li><a href="/admin/page/about-us" class="tables menudrop"><span>Quản lý trang thông tin</span></a>
                	<ul>
                    	<li><a href="/admin/page/about-us"><span>Về chúng tôi</span></a></li>
                    	<li><a href="/admin/page/regulation"><span>Quy chế sàn giao dịch</span></a></li>
                    	<li><a href="/admin/page/business-cooperation"><span>Cho doanh nghiệp</span></a></li>
                    	<li><a href="/admin/page/recruitment"><span>Cơ hội nghề nghiệp</span></a></li>
                    	<li><a href="/admin/page/buying-guide"><span>Hỗ trợ mua hàng</span></a></li>
                    	<li><a href="/admin/page/returns-policy"><span>Chính sách trả hàng</span></a></li>
                    	<li><a href="/admin/page/delivery"><span>Giao nhận hàng</span></a></li>
                    	<li><a href="/admin/page/payments"><span>Hình thức thanh toán</span></a></li>
                    </ul>
                </li>
                <% } %>
                <% if (roles.contains("all") || roles.contains("permission-manager")) { %>
                <li><a href="/admin/system/permission" class="permission"><span>Phân quyền hệ thống</span></a>
                <% } %>
			</ul>
		</li>
	</ul>
	<% } %>
	<br style="clear: left" />
</div>
<br />
<% } %>